import React from 'react'
import './welecome.less'
import { Link } from "react-router-dom";
function Welecome(props) {
    const [w_msg] = React.useState(["欢","迎","来","到","李","明","月","的","个","人","博","客","！"])
    React.useEffect(()=>{
        const msgdom:Element = document.getElementsByClassName("w_msg")[0];
        const spans:any = msgdom.getElementsByTagName("span");
        setTimeout(()=>{
            for(let i=0;i<spans.length;i++){
                spans[i].style.opacity = "1";
                spans[i].style.transform = "translateY(0px) scale(1)"
                // console.log(spans[i])
            }
        },500)
    },[])
    return (<div id="welecome">
         <div className='w_con'>
             <p className='w_msg'>{w_msg.map((v,index)=>{
                return <span key={index}>{v}</span>
             })}</p>
             <img src="./img/t.jpeg" alt="img load fail"/>
             <div className="wrapper">
  <Link to="/home" className="button">进入博客</Link>
</div>
         </div>
    </div>)
}
export default Welecome
